package com.weic.vo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;

@Component
public class Student {

    @Value("weic")
    private String name;

    private String[] bookArr;

    private List<String> bookList;

    private Set<String> bookSet;

    private Map<String,String> bookMap;

    private List<Book> bookObjectList;

    public List<Book> getBookObjectList() {
        return bookObjectList;
    }

    public void setBookObjectList(List<Book> bookObjectList) {
        this.bookObjectList = bookObjectList;
    }

    public Student() {
        System.out.println("1.Student Constructor");
    }

    public Student(String name, String[] bookArr, List<String> bookList, Set<String> bookSet, Map<String, String> bookMap) {
        this.name = name;
        this.bookArr = bookArr;
        this.bookList = bookList;
        this.bookSet = bookSet;
        this.bookMap = bookMap;
    }

    public void initStudnet(){
        System.out.println("3.initStudnet...");
    }

    public void destroyedStudent(){
        System.out.println("5.destroyedStudent...");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        System.out.println("2.setName");
        this.name = name;
    }

    public String[] getBookArr() {
        return bookArr;
    }

    public void setBookArr(String[] bookArr) {
        this.bookArr = bookArr;
    }

    public List<String> getBookList() {
        return bookList;
    }

    public void setBookList(List<String> bookList) {
        this.bookList = bookList;
    }

    public Set<String> getBookSet() {
        return bookSet;
    }

    public void setBookSet(Set<String> bookSet) {
        this.bookSet = bookSet;
    }

    public Map<String, String> getBookMap() {
        return bookMap;
    }

    public void setBookMap(Map<String, String> bookMap) {
        this.bookMap = bookMap;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", bookArr=" + Arrays.toString(bookArr) +
                ", bookList=" + bookList +
                ", bookSet=" + bookSet +
                ", bookMap=" + bookMap +
                ", bookObjectList=" + bookObjectList +
                '}';
    }
}
